<template>
    <view>
        <a-card>
            <a-descriptions title="论文信息" bordered>
                <a-descriptions-item label="DOI (数字资源标识符)">
                    <a @click="$.copyText(record.doi)">
                        {{ record.doi }}
                        <CopyOutlined></CopyOutlined>
                    </a> </a-descriptions-item>
                <a-descriptions-item label="署名单位" :span="2"> {{ record.signatureUnit }}</a-descriptions-item>
                <a-descriptions-item label="期刊名称"> {{ record.journalName }}
                </a-descriptions-item>
                <a-descriptions-item label="期刊信息" :span="2">
                    <PaperDict :dictId="record.paperDictId" />
                </a-descriptions-item>
                <a-descriptions-item label="论文名称" :span="1">
                    <a @click="$.copyText(record.paperTitle)">
                        {{ record.paperTitle }}
                        <CopyOutlined></CopyOutlined>
                    </a>
                </a-descriptions-item>
                <a-descriptions-item label="论文字数" :span="1">{{ record.paperNumber }} (字)</a-descriptions-item>
                <a-descriptions-item label="负责人字数" :span="1">{{ record.chargeNumber }} (字)</a-descriptions-item>
                <a-descriptions-item label="发表日期" :span="1">{{ formatDate(record.publicationDate) }}</a-descriptions-item>
                <a-descriptions-item label="状态" :span="3">
                    <!--执行状态-->
                    <a-tag color="green" v-if="record.status == 1">已通过</a-tag>
                    <a-tag color="grey" v-else-if="record.status == 0">未确认</a-tag>
                    <a-tag color="red" v-else>已关闭</a-tag>
                </a-descriptions-item>
                <a-descriptions-item label="附件信息">

                </a-descriptions-item>
            </a-descriptions>
        </a-card>

    </view>
</template>
<script setup>
import userApp from '@/hooks'
const { $ } = userApp()
import { SmileOutlined, DownOutlined, CopyOutlined, QuestionCircleOutlined } from '@ant-design/icons-vue';
import PaperDict from './PaperDict.vue';
// 参数now： 传入时间戳，如 1595768303270
function formatDate(now) {
    const date = new Date(now)
    var y = date.getFullYear() // 年份
    var m = date.getMonth() + 1 // 月份，注意：js里的月要加1
    var d = date.getDate() // 日
    var h = date.getHours() // 小时
    var min = date.getMinutes() // 分钟
    var s = date.getSeconds() // 秒
    // 返回值，根据自己需求调整，现在已经拿到了年月日时分秒了 
    return y + '-' + m + '-' + d 
}

const props = defineProps({
    record: {
        type: Object
    }
})
</script>